﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DLL;
using Microsoft.Reporting.WinForms;

namespace QuanLyBanLe
{
    public partial class FormOutProdPaperPrint : Form
    {
        private List<pOutProdDetail_Get_Result> m_OutProdDetails;
        private DateTime m_OutDate;
        private string m_ToShop;

        public FormOutProdPaperPrint(List<pOutProdDetail_Get_Result> outProdDetails,
            DateTime outDate, string toShop)
        {
            InitializeComponent();
            m_OutProdDetails = outProdDetails;
            m_OutDate = outDate;
            m_ToShop = toShop;
        }

        private void FormOutProdPaperPrint_Load(object sender, EventArgs e)
        {
            this.Text += FormMain.GetShopInfo();
            this.GetOutProdDetail_ResultBindingSource.DataSource = m_OutProdDetails;
            IList<ReportParameter> parameters = new List<ReportParameter>();
            parameters.Add(new ReportParameter("outDate", m_OutDate.ToString(Core.Formats.DateTimeFormat)));
            parameters.Add(new ReportParameter("toShop", m_ToShop));
            this.reportViewer1.LocalReport.SetParameters(parameters);
            this.reportViewer1.RefreshReport();
        }
    }
}
